package com.gxy.learn.design.model.behaviour.mediator;

/**
 * @description: 中介模式测试
 * @author: gaoxueyong
 * @Date: 2022/11/8 21:15
 */
public class Client {
    public static void main(String[] args) {
//        创建中介者对象
        MediatorStructure mediatorStructure = new MediatorStructure();
//        创建房主对象
        HouseOwner houseOwner = new HouseOwner("张三",mediatorStructure);
        mediatorStructure.setHouseOwner(houseOwner);
//        创建租房者
        Tenant tenant = new Tenant("李四",mediatorStructure);
        mediatorStructure.setTenant(tenant);
        tenant.constact("我要租房！");
        houseOwner.constact("我有三居室，你要租吗？");

    }
}
